Cytosim  PI
Cytoskeleton Simulator
Matrix Class Referenceabstract
Inheritance diagram for Matrix:
MatrixSparse MatrixSparseBandSymmetric MatrixSparseSymmetric MatrixSparseSymmetric1 MatrixSymmetric

Public Types

typedef unsigned int index_type
 type of an index into the matrix
 

Public Member Functions

 Matrix ()
 empty constructor
 
virtual ~Matrix ()
 empty destructor
 
virtual void allocate (unsigned int sz)=0
 allocate the matrix to hold ( sz * sz ), all values are lost
 
virtual realaddr (index_type x, index_type y) const =0
 returns the address of element at (x, y), no allocation is done
 
virtual realoperator() (index_type x, index_type y)=0
 returns the address of element at (x, y), allocating if necessary
 
real value (index_type x, index_type y) const
 returns the value of element at (x, y) or zero if not allocated
 
virtual unsigned int size () const =0
 returns the size of the matrix
 
virtual void makeZero ()=0
 set all the elements to zero
 
virtual void scale (real)=0
 scale the matrix by a scalar factor
 
void copyBlock (real *M, index_type x, unsigned int sx, index_type y, unsigned int sy) const
 copy the block ( x, y, x+sx, y+sy ) from this matrix into M
 
virtual void addDiagonalBlock (real *M, index_type x, unsigned int sx) const
 add the block ( x, x, x+sx, x+sx ) from this matrix to M
 
virtual void addTriangularBlock (real *M, index_type x, unsigned int sx) const
 add the upper triangular half of the block ( x, x, x+sx, x+sx ) from this matrix to M
 
virtual void prepareForMultiply ()
 Optional optimization to accelerate multiplications below.
 
virtual void vecMulAdd (const real *X, real *Y) const =0
 Vector multiplication: Y <- Y + M * X, size(X) = size(Y) = size(M)
 
virtual void vecMul (const real *X, real *Y) const
 Vector multiplication: Y <- M * X, size(X) = size(Y) = size(M)
 
virtual void vecMulAddIso2D (const real *, real *) const =0
 isotropic vector multiplication: Y = Y + M * X, size(X) = size(Y) = 2 * size(M)
 
virtual void vecMulAddIso3D (const real *, real *) const =0
 isotropic vector multiplication: Y = Y + M * X, size(X) = size(Y) = 3 * size(M)
 
virtual real maxNorm () const
 maximum absolute value considering all the elements
 
virtual bool nonZero () const
 true if the matrix is non-zero
 
virtual unsigned int nbNonZeroElements () const
 number of element which are non-zero
 
virtual std::string what () const =0
 returns a string which a description of the type of matrix
 
virtual void printSparse (std::ostream &) const
 printf debug function in sparse mode: i, j : value
 
virtual void printFull (std::ostream &) const
 printf debug function in full lines, all columns